package com.github.xiaolyuh.flush.coupon;

import com.github.xiaolyuh.LocalCacheConfigManager;
import com.github.xiaolyuh.flush.AbstractLocalCacheFlushManager;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component(value = "couponLocalCacheFlushManager")
public class CouponLocalCacheFlushManager extends AbstractLocalCacheFlushManager {

    @Override
    public void clear(Set<String> keyList) {
        if(keyList == null){
            return;
        }
        //清除系统coupon详情、商品、店铺缓存
        LocalCacheConfigManager.getInstance().getSystemCouponLocalCache().invalidateAll(keyList);

        //清除普通coupon详情缓存
        LocalCacheConfigManager.getInstance().getNormalCouponLocalCache().invalidateAll(keyList);
    }

}
